home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / mg2a_src.zip / SYS / DEFAULT / CHRDEF.H < prev    next >
C/C++ Source or Header  |  1988-08-23  |  2KB  |  80 lines

  1. /*
  2.  * sys/default/chardef.h: character set specific #defines for mg 2a
  3.  * Warning: System specific ones exist
  4.  */
  5.  
  6. #ifndef    CHARMASK
  7. /*
  8.  * casting should be at least as efficent as anding with 0xff,
  9.  * and won't have the size problems.  Override in sysdef.h if no
  10.  * unsigned char type.
  11.  */
  12. #define    CHARMASK(c)    ((unsigned char) (c))
  13. #endif
  14.  
  15. /*
  16.  * These flags, and the macros below them,
  17.  * make up a do-it-yourself set of "ctype" macros that
  18.  * understand the DEC multinational set, and let me ask
  19.  * a slightly different set of questions.
  20.  */
  21. #define _W    0x01            /* Word.            */
  22. #define _U    0x02            /* Upper case letter.        */
  23. #define _L    0x04            /* Lower case letter.        */
  24. #define _C    0x08            /* Control.            */
  25. #define _P    0x10            /* end of sentence punctuation    */
  26. #define    _D    0x20            /* is decimal digit        */
  27.  
  28. #define ISWORD(c)    ((cinfo[CHARMASK(c)]&_W)!=0)
  29. #define ISCTRL(c)    ((cinfo[CHARMASK(c)]&_C)!=0)
  30. #define ISUPPER(c)    ((cinfo[CHARMASK(c)]&_U)!=0)
  31. #define ISLOWER(c)    ((cinfo[CHARMASK(c)]&_L)!=0)
  32. #define ISEOSP(c)    ((cinfo[CHARMASK(c)]&_P)!=0)
  33. #define    ISDIGIT(c)    ((cinfo[CHARMASK(c)]&_D)!=0)
  34. #define TOUPPER(c)    ((c)-0x20)
  35. #define TOLOWER(c)    ((c)+0x20)
  36.  
  37. /*
  38.  * generally useful thing for chars
  39.  */
  40. #define CCHR(x)        ((x) ^ 0x40)    /* CCHR('?') == DEL */
  41.  
  42. #ifndef    METACH
  43. #define    METACH    CCHR('[')
  44. #endif
  45.  
  46. #ifdef    XKEYS
  47. #define    K00    256
  48. #define    K01    257
  49. #define    K02    258
  50. #define    K03    259
  51. #define    K04    260
  52. #define    K05    261
  53. #define    K06    262
  54. #define    K07    263
  55. #define    K08    264
  56. #define    K09    265
  57. #define    K0A    266
  58. #define    K0B    267
  59. #define    K0C    268
  60. #define    K0D    269
  61. #define    K0E    270
  62. #define    K0F    271
  63. #define    K10    272
  64. #define    K11    273
  65. #define    K12    274
  66. #define    K13    275
  67. #define    K14    276
  68. #define    K15    277
  69. #define    K16    278
  70. #define    K17    279
  71. #define    K18    280
  72. #define    K19    281
  73. #define    K1A    282
  74. #define    K1B    283
  75. #define    K1C    284
  76. #define    K1D    285
  77. #define    K1E    286
  78. #define    K1F    287
  79. #endif
  80.